
$(function () {
	$(".myDate").datepick();
	$("#addSpecification").click(function () {
	   if($("#specificationTable >tbody >tr").length<10){
	   	    $("#specificationTable >tbody").append($("#specificationTemple >tbody >tr").clone());
	   }
	});
	$("#deleteSpecification").click(function () {
		$("#specificationTable >tbody >tr .checkBox:checked").each(function (index) {
			$(this).parent().parent().remove();
		});
	});
	
	$("#addStock").click(function () {
		if($("#stockTable >tbody >tr").length<10){
			$("#stockTable >tbody").append($("#stockTemple >tbody >tr").clone());
		}
	});
	$("#deleteStock").click(function () {
		$("#stockTable >tbody >tr .checkBox:checked").each(function (index) {
			$(this).parent().parent().remove();
		});
	});
	$("#newVisit").click(function () {
			 var returnVar=window.showModalDialog("page/redetailer/planPop.jsp","","dialogWidth=500px;dialogHeight=300px");
	});
	$(".specification").click(function () {
			 var returnVar=window.showModalDialog("page/redetailer/specificationPop.jsp","","dialogWidth=500px;dialogHeight=300px");
	});
});

